package ms.maplestory.boot.enums;

import java.util.Arrays;

/**
 * 传送点类型
 */
public enum PortalType {

    StartPoint(0),
    PortalInvisible(1),
    PortalVisible(2),
    PortalCollision(3),
    PortalChangable(4),
    PortalChangableInvisible(5),
    TownPortalPoint(6),
    PortalScript(7),
    PortalScriptInvisible(8),
    PortalCollisionScript(9),
    PortalHidden(10),
    PortalScriptHidden(11),
    PortalCollisionJump(12),
    PortalCollisionCustom(13),
    PortalCollisionInvisibleChangable(14),
    PortalUnk(15);

    private byte value;

    PortalType(int value) {
        this.value = (byte) value;
    }

    public byte getValue() {
        return value;
    }

    public static PortalType getTypeByInt(int i) {
        return Arrays.stream(values()).filter(p -> p.getValue() == i).findFirst().orElse(null);
    }
}
